{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "import time\n",
    "import bisect\n",
    "import itertools\n",
    "from datetime import datetime\n",
    "import ligging\n",
    "default_data_dir='./data/'\n",
    "default_write_buffer_size=1024*10\n",
    "default_read_buffer_size=1024*10\n",
    "default_index_interval=1000\n",
    "\n",
    "def ensure_data_dir():\n",
    "    if not os.path.exists(default_data_dir):\n",
    "        os.makedirs(default_data_dir)\n",
    "        \n",
    "def init():\n",
    "    ensure_data_dir()\n",
    "class wawaindex():\n",
    "    def __init__(self,index_name):\n",
    "        self.fp_index=open(os.path.join(default_data_dir,index_name+'.index'),'a',1)\n",
    "        self.indexs,self.offsets,self.index_count=[],[],0\n",
    "        self.__load_index()\n",
    "    def __update_index(self,key,offsets):\n",
    "        self.indexs.append(key)\n",
    "        self.offsets.append(offsets)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
